﻿using System;
using System.Collections.Generic;

namespace IOA.MES.DataAccess.VModel
{
    public class VLoadInspect : BaseVModel
    {
        private string _cabinetNo = string.Empty;
        private string _actualCabinetNo;
        private string _numberPlate;
        private string _phone;
        private string _driver;
        private string _lockNo;
        private string _deliveryNo;

        #region Public Property

        /// <summary>
        /// 发货单号
        /// </summary>
        public string DeliveryNo
        {
            get { return string.IsNullOrWhiteSpace(_deliveryNo) ? string.Empty : _deliveryNo; }
            set { _deliveryNo = value; }
        }

        ///<Summary>
        /// 柜号
        ///</Summary>
        public string CabinetNo
        {
            get { return string.IsNullOrWhiteSpace(_cabinetNo) ? string.Empty : _cabinetNo; }
            set { _cabinetNo = value; }
        }

        ///<Summary>
        /// 装车状态
        ///</Summary>
        public Enum.LoadStatus LoadStatus { get; set; }

        ///<Summary>
        /// 数量
        ///</Summary>
        public int Quantity { get; set; }

        ///<Summary>
        /// 已装车数量
        ///</Summary>
        public int LoadedQuantity { get; set; }

        /// <summary>
        /// 司机
        /// </summary>
        public string Driver
        {
            get { return string.IsNullOrWhiteSpace(_driver) ? string.Empty : _driver; }
            set { _driver = value; }
        }

        /// <summary>
        /// 联系方式
        /// </summary>
        public string Phone
        {
            get { return string.IsNullOrWhiteSpace(_phone) ? string.Empty : _phone; }
            set { _phone = value; }
        }

        /// <summary>
        /// 车牌号
        /// </summary>
        public string NumberPlate
        {
            get { return string.IsNullOrWhiteSpace(_numberPlate) ? string.Empty : _numberPlate; }
            set { _numberPlate = value; }
        }

        /// <summary>
        /// 真实柜号
        /// </summary>
        public string ActualCabinetNo
        {
            get { return string.IsNullOrWhiteSpace(_actualCabinetNo) ? string.Empty : _actualCabinetNo; }
            set { _actualCabinetNo = value; }
        }

        ///<Summary>
        /// 装车人
        ///</Summary>
        public int LoadBy { get; set; }

        ///<Summary>
        /// 完成时间
        ///</Summary>
        public DateTime? FinishTime { get; set; }

        /// <summary>
        /// 锁号
        /// </summary>
        public string LockNo
        {
            get { return string.IsNullOrWhiteSpace(_lockNo) ? string.Empty : _lockNo; }
            set { _lockNo = value; }
        }
        #endregion

        ///<Summary>
        /// 装车人
        ///</Summary>
        public string CNLoadBy { get; set; }

        /// <summary>
        /// 订单状态
        /// </summary>
        public string CNStatus { get { return !System.Enum.IsDefined(typeof(Enum.LoadStatus), LoadStatus) ? string.Empty : EnumConvert.ToDesc(LoadStatus); } }

        /// <summary>
        /// 完成时间
        /// </summary>
        public string FinishTimeStr { get { return FinishTime?.ToString("yyyy-MM-dd HH:mm:ss"); } }

        /// <summary>
        /// 包装列表
        /// </summary>
        public List<VLoadPack> Packs { get; set; } = new List<VLoadPack>();
    }
}
